﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Backend/Backend.Master" Inherits="System.Web.Mvc.ViewPage<IntroduceCompany.VideoView>" %>
<%@Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	VideoEdit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" src="<%= Url.Content("../../../Content/Backend/js/ckeditor/ckeditor.js")%>"></script>
<!-- Begin one column tab content window -->
    <div class="onecolumn">
        <div class="header">
            <span>Thêm ngôn ngữ hoặc chỉnh sửa clip</span>
            <div class="switchbutton">
            <% if (Model.VideoVisible)
            {%>
                <a href="<%= Url.Action("Frontend_VideoList2", "Video", new { videoID = Model.VideoID, languageID = Model.LanguageID })%>" target="_blank" title="Xem clip" class="button">
                Xem nhanh</a>
          <%} %>
                <a href="<%= Url.Action("VideoCreate", "Video") %>" class="button">Thêm mới</a>
                <a href="<%= Url.Action("VideoList", "Video") %>" class="button">Danh sách</a>
            </div>
        </div>
        <br class="clear" />
        <div class="content">
            
            <div class="display-label error">
                <div class="errorcontent">
                    <p><%= Html.ValidationMessage("Notice")%></p>
                    <p><%= Html.ValidationMessageFor(model => model.VideoTitle)%></p>
                    <p><%= Html.ValidationMessageFor(model => model.VideoURL) %></p>
                    <p><%= Html.ValidationMessageFor(model => model.VideoDescription)%></p>
                </div>
            </div>
            
            <% using (Html.BeginForm("Edit", "Video", FormMethod.Post)){%>
            <div>
                <label>Ngôn ngữ:</label><br />
                <%= Html.DropDownList("languageID", (SelectList)ViewData["LaguageList"], new { @style = "width:300px;", onchange = "this.form.submit();" })%>
                <%= Html.HiddenFor(model => model.VideoID)%>
                <%= Html.HiddenFor(model => model.VideoVisible)%>
            </div><br class="clear"/>
            <%} %>


             <% using (Html.BeginForm("VideoEdit", "Video", FormMethod.Post)) {%>
                <%= Html.AntiForgeryToken(IntroduceCompany.Util.AntiKey.EditSalt)%>
            <div>
                <div class="editor_left">
                    <label>Ngày chỉnh sửa cuối:</label>
                    <%= IntroduceCompany.Util.GeneralClass.ConvertDate_1B(Model.VideoDate)%>
                </div>
                <div class="editor_middle">
                    <label>Người chỉnh sửa cuối:</label>
                    <%= Model.FullName%>
            </div>
            </div><br class="clear"/><br />
            <div>
                <div class="editor_left">
                    <label>Mã số:</label><br />
                    <%= Html.TextBoxFor(model => model.VideoID, new { @readonly = "readonly" })%>
                </div>
                <div class="editor_middle">
                    <label>Link mới:</label><br />
                    <%= Html.TextBox("linkURL") %>
                    <%= Html.HiddenFor(model => model.VideoURL) %>
                    <%= Html.HiddenFor(model => model.VideoVisible) %>
                    <%= Html.HiddenFor(model => model.LanguageID) %>
                </div>
            </div><br class="clear"/><br />
            <div>
                <label>Chủ đề clip:</label><br />
                <%= Html.TextBoxFor(model => model.VideoTitle, new { @style = "width:620px;", maxlength = "120" })%>
            </div><br class="clear"/><br />
            <div>
                <iframe src="http://www.youtube.com/embed/<%= Model.VideoURL%>" width="631" height="385" frameborder="0" ></iframe>
            </div><br class="clear"/>
            <div>
                <label>Mô tả clip:</label><br />
                <%= Html.TextAreaFor(model => model.VideoDescription, new { @class = "ckeditor" })%>
            </div><br class="clear"/>
            <p>
                <input type="submit" value="Lưu" />
                <a href="<%= Url.Action("Edit", "Video", new { videoID = Model.VideoID, languageID = Model.LanguageID }) %>"  class="buttonform">Làm Lại</a>
            </p>
            <script type="text/javascript">
                CKEDITOR.replace('VideoDescription', {
                    BasePath: '../../../Content/Backend/js/ckeditor/',
                    customConfig: 'CustomAdmin.js'
                });
	        </script>
        <% } %>
        </div>
    </div>
</asp:Content>

